package xyz.yq56.easytool.utils.runtime;

/**
 * Runtime工具
 *
 * @author yi qiang
 * @date 2021/9/23 1:55
 */
public class RuntimeUtil {

    private RuntimeUtil() {
    }

    public static int availableProcessors() {
        return Runtime.getRuntime().availableProcessors();
    }

    public static double freeMemory() {
        return Runtime.getRuntime().freeMemory() / 1048576.00;
    }

    public static double totalMemory() {
        return Runtime.getRuntime().totalMemory() / 1048576.00;
    }

    public static double maxMemory() {
        return Runtime.getRuntime().maxMemory() / 1048576.00;
    }

}
